<?php $website_url = Configure::read('Website.url'); 
	//pr($subcats);
	//exit;
?>
<?php $website_url = Configure::read('Website.url'); ?>

<div class="cat_page">
     <div class="cat_page_left"> <?php echo $this->element('cat_page_left');?> </div>
     <div class="cat_page_right">
          <div class="item_list_show">
               <h2><?php echo $Category['Category']['name']/*$html->link($catgory['Category']['name'], 
				array('controller'=>'categories', 'action'=>'subcategories', $catgory['Category']['slug']))*/; ?> Featured Categories</h2>
               <?php
	if(isset($subcats) and ($subcats) )
		{
	?>
               <div class="def_div f_left">
                    <?php
		$i =1;
		foreach($subcats as $subcat)
			{
		?>
                    <div class="item_cat_list">
                         <ul>
                              <li>
                                   <?php
				if(isset($subcat['Category']['img']) and ($subcat['Category']['img'])) 
					{
						echo $html->link($html->image("Category/".$subcat['Category']['img'], array('height'=>'240', 'width'=>'371')), 
						array('controller'=>'products', 'action'=>'index','parent_cat_slug'=>$cat_slug, $subcat['Category']['slug'], /*base64_encode("Parent")*/), array('escape'=>false));
					} 
				?>
                                   <br />
                                   <b> <?php echo $html->link($subcat['Category']['name'], 
                   array('controller'=>'products', 'action'=>'index', 'parent_cat_slug'=>$cat_slug,$subcat['Category']['slug']/*, base64_encode("Parent")*/)); ?> </b> </li>
                              <?php
		if(isset($subcat['Category']['subcategories']) and ($subcat['Category']['subcategories']))
			{
  ?>
                              <?php
								foreach( $subcat['Category']['subcategories'] as $Subsubcats)
									{
										
									?>
                              <li><span>&bull;</span><?php echo $html->link($Subsubcats['Category']['name'], 
							   array('controller'=>'products', 'action'=>'index', 'parent_cat_slug'=>$cat_slug, $Subsubcats['Category']['slug'])); ?></li>
                              <?php
									}
            }
	 ?>
                         </ul>
                    </div>
                    <?php
		       if($i%4==0)
			   {
				   echo "<div class='clear'></div>";
			   }
            $i++;
			 }
    ?>
               </div>
               <?php
		   }
	  ?>
          </div>
          <div class="item_list_show">
               <h2>Featured Brands</h2>
               <?php
	if(isset($custum_brands) and ($custum_brands) )
		{
	?>
               <div class="def_div f_left">
                    <?php
		$i =1;
		foreach($custum_brands as $custum_brand)
			{
				//pr($custum_brand);
				//exit;
		?>
                    <div class="item_cat_list">
                         <ul>
                              <li>
                                   <?php
				if(isset($custum_brand['Brand']['img']) and ($custum_brand['Brand']['img'])) 
					{
						echo $html->link($html->image("Brand/".$custum_brand['Brand']['img'], array('height'=>'240', 'width'=>'371')), 
						array('controller'=>'products', 'action'=>'index','category_slug'=>$cat_slug,"brand_slug"=> $custum_brand['Brand']['slug'], /*base64_encode("Parent")*/), array('escape'=>false));
					} 
				?>
                                   <br />
                                   <b> <?php echo $html->link($custum_brand['Brand']['name'], 
                   array('controller'=>'products', 'action'=>'index', 'category_slug'=>$cat_slug,"brand_slug"=>$custum_brand['Brand']['slug']/*, base64_encode("Parent")*/)); ?> </b> </li>
                         </ul>
                    </div>
                    <?php
		       if($i%4==0)
			   {
				   echo "<div class='clear'></div>";
			   }
            $i++;
			 }
    ?>
               </div>
               <?php
		   }
	  ?>
          </div>
          <div class="def_div f_left">
           <h2>More Items to Consider</h2>
	<?php
	if(isset($products) and ($products))
		{
            $x =1;
			foreach($products as $product)
				{
                ?>
                <div class="item_list" style=" width:164px;"><!--item_list_B-->
                  <ul>
                    <li> <?php echo $html->link($html->image('Product/'.$product['Product']['img'], array('style'=>'width: 130px;')), array('controller'=>'products', 'action'=>'product', $product['Product']['slug']), array('escape'=>false,));?></li>
                    <li><span><?php echo $html->link($product['Product']['name'], array('controller'=>'products', 'action'=>'product', $product['Product']['slug']), array('escape'=>false));?></span></li>
                    <li>
                      <p>
                      
                      
                      <?php echo $html->link($product['Product']['condition']['name'], array('controller'=>'products', 'action'=>'offer_listing', $product['Product']['wisn'], $product['Product']['condition']['slug']), array('escape'=>false));?>
                      
                      
                       <span class="over_line">$<?php echo $product['Product']['msrp']; ?></span> 
                       <span class="red">$ <?php echo $product['Product']['MasterProduct']['price']; ?></span></p>
                    </li>
				<?php
					$date = mktime(0, 0, 0, date("m")  , date("d")+2, date("Y"));
                ?>
                    <li>
                      <p>Get it by <b><?php echo date("D M d", $date); ?></b> if you order in the <b>next 16 hours</b> and choose one-day shipping.</p>
                    </li>
                    <li>
                      <p><?php echo $product['Product']['stock_detail'];?>....</p>
                    </li>
                    <li>
                      <div class="rating_<?php echo $product['Product']['rating'];?> f_left">&nbsp;</div>
                      <p>&nbsp;<?php __get_pr_reviews($product['Product']['id']); ?></p>
                    </li>
                  </ul>
                </div>
                <?php
					if($x%4 == 0)
					    {
							echo "<div class='clear'></div><div class='common_border1'></div>";
						}
					$x++; 
				}
                 ?>
                <div class="paging_gray" style="line-height: 35px;"> <?php echo $this->element('paging');?> <span class="f_right"> </span> </div>
             
              <?php 
                }
            ?>
 </div>
     </div>
</div>
